package com.dandelion.common.dao.auto.mapper;

import com.dandelion.common.dao.auto.pojo.ServiceCategoryRelation;
import com.dandelion.common.dao.auto.pojo.ServiceCategoryRelationCriteria;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ServiceCategoryRelationMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @SelectProvider(type=ServiceCategoryRelationSqlProvider.class, method="countByExample")
    long countByExample(ServiceCategoryRelationCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @DeleteProvider(type=ServiceCategoryRelationSqlProvider.class, method="deleteByExample")
    int deleteByExample(ServiceCategoryRelationCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Delete({
        "delete from t_service_category_relation",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Insert({
        "insert into t_service_category_relation (cat_id, svr_id, ",
        "is_deleted, create_time, ",
        "update_time)",
        "values (#{catId,jdbcType=INTEGER}, #{svrId,jdbcType=INTEGER}, ",
        "#{isDeleted,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, ",
        "#{updateTime,jdbcType=TIMESTAMP})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(ServiceCategoryRelation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @InsertProvider(type=ServiceCategoryRelationSqlProvider.class, method="insertSelective")
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insertSelective(ServiceCategoryRelation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @SelectProvider(type=ServiceCategoryRelationSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="cat_id", property="catId", jdbcType=JdbcType.INTEGER),
        @Result(column="svr_id", property="svrId", jdbcType=JdbcType.INTEGER),
        @Result(column="is_deleted", property="isDeleted", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<ServiceCategoryRelation> selectByExample(ServiceCategoryRelationCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Select({
        "select",
        "id, cat_id, svr_id, is_deleted, create_time, update_time",
        "from t_service_category_relation",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="cat_id", property="catId", jdbcType=JdbcType.INTEGER),
        @Result(column="svr_id", property="svrId", jdbcType=JdbcType.INTEGER),
        @Result(column="is_deleted", property="isDeleted", jdbcType=JdbcType.TINYINT),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.TIMESTAMP)
    })
    ServiceCategoryRelation selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @UpdateProvider(type=ServiceCategoryRelationSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ServiceCategoryRelation record, @Param("example") ServiceCategoryRelationCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @UpdateProvider(type=ServiceCategoryRelationSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ServiceCategoryRelation record, @Param("example") ServiceCategoryRelationCriteria example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @UpdateProvider(type=ServiceCategoryRelationSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ServiceCategoryRelation record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table t_service_category_relation
     *
     * @mbg.generated Wed May 09 22:05:54 CST 2018
     */
    @Update({
        "update t_service_category_relation",
        "set cat_id = #{catId,jdbcType=INTEGER},",
          "svr_id = #{svrId,jdbcType=INTEGER},",
          "is_deleted = #{isDeleted,jdbcType=TINYINT},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "update_time = #{updateTime,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ServiceCategoryRelation record);
}